<?php
/**
 * Created by PhpStorm.
 * User: geyouwen
 * Date: 17/1/22
 * Time: 下午1:14
 */

namespace App\Console\Commands;


use App\Model\UserModel;
use Illuminate\Console\Command;

class SendMail extends Command
{

    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'sendMail';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description.';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        //这里是要执行的程序
        $this->line("start: " . date("Y-m-d H:i:s"));
//        $user = new UserModel();
//        $list = $user->getall()->toArray();
//        print_r($list);
        file_put_contents('/var/log/test.log', time(), FILE_APPEND);
        $this->line("end: " . date("Y-m-d H:i:s"));
    }
}